//
//  SucceeViewController.m
//  HuaXin
//
//  Created by 江伟 on 2018/11/6.
//

#import "SucceeViewController.h"

@interface SucceeViewController ()
@property (weak, nonatomic) IBOutlet UIImageView *img;
@property (weak, nonatomic) IBOutlet UILabel *titleLab;
@property (weak, nonatomic) IBOutlet UILabel *descripLab;
@property (weak, nonatomic) IBOutlet UIButton *btn;

@end

@implementation SucceeViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    self.title = @"余额兑换";
    if ([self.info integerValue] == 0) {
        self.img.image = IMG(@"shibai");
        self.titleLab.text = @"哇哦！余额不足";
        self.descripLab.text = @"您的余额兑换失败，请立即去充值之后再购物吧!";
        [self.btn setTitle:@"去充值" forState:UIControlStateNormal];
    } else {
        self.img.image = IMG(@"chenggong");
        self.titleLab.text = @"恭喜您！余额兑换成功";
        self.descripLab.text = @"您的余额兑换成功，您可以直接用优惠券去购物啦！";
        [self.btn setTitle:@"返回首页" forState:UIControlStateNormal];
    }
    // Do any additional setup after loading the view from its nib.
}

/// 点击按钮
- (IBAction)clickBtn:(UIButton *)sender {
    if ([self.info integerValue] == 0) {//失败去充值
        
    } else {
        [self.navigationController popToRootViewControllerAnimated:YES];
    }
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
